home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
datatypes
/
playdt13.lha
/
PlayDT
/
PlayDT-src
/
PlayDT.c
next >
Wrap
C/C++ Source or Header
|
1997-06-05
|
2KB
|
84 lines
/****************************************************************
*
* $VER: PlayDT.c 1.3 (4.6.97) Tak Tang (tst92@ecs.soton.ac.uk)
*
* Usage : PlayDT FILE/M REQUESTER/S
* or : (From workbench) as the default tool in a project icon
*
* Description : Plays sound samples using datatypes.
* Supports pattern matching.
*
* Copyright © 1997 Tak Tang
*
* You may use any part of this source code in your own programs
* provided that it is not called PlayDT.
*
*****************************************************************/
/**** Header files ****/
#include "PlayDT.h"
#include <exec/memory.h>
#include <workbench/startup.h>
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <pragmas/dos_pragmas.h>
#include <pragmas/exec_pragmas.h>
/**** Storage ****/
UBYTE VersTag[]="\0$VER: " PROGNAME " " PROGVER " " PROGDATE;
extern struct Library *DOSBase;
struct Library *IntuitionBase;
struct Library *DataTypesBase;
/**** Main entry ****/
void main(int argc, char **argv)
{
struct ExecBase *SysBase = (*((struct ExecBase **) 4));
struct GlobalData *gd;
gd = AllocVec (sizeof (struct GlobalData), MEMF_CLEAR);
if ( gd )
{
gd->SysBase = SysBase;
if (gd->DataTypesBase = OpenLibrary ("datatypes.library", 39L))
{
DataTypesBase=gd->DataTypesBase;
gd->MeTask=(ULONG) FindTask (NULL); /* Cache this task */
if (0==argc)
{
UseWB( gd, (struct WBStartup *)argv );
} /* run from workbench */
else
{
UseCLI( gd);
} /* run from shell */
if (gd->IntuitionBase) CloseLibrary(gd->IntuitionBase);
CloseLibrary(gd->DataTypesBase);
} /* if OpenLibrary(DataTypes) OK */
else
{
PrintFault (IoErr (), MSG_FAILED);
} /* if OpenLibrary(DataTypes) failed */
FreeVec (gd);
} /* if AllocVec(struct GlobalData) */
} /* main() */
/**** End of file ****/